@extends('welcome')
@section('zhong_content')
<style type="text/css">
	.ww{padding-left: 300px;}
	.mimi{padding-left: 300px;}
	.ss{padding-left: 600px;font-size:20px;color:#1F409C;}
</style>
<link href="/Home/ider/support.css" rel="stylesheet" type="text/css" />
@if(session('success'))
	<span style="color:red">{{session('success')}}</span>
@endif
@if(session('error'))
	<span style="color:red">{{session('error')}}</span>
@endif
<div class="ss"><span class="d"><a href="">大家在说</a></span><span class="mi" style="padding-left:20px"><a href="">我要说一下</a></span></div>
<div style="height:20px;"></div>
<hr>
<script type="text/javascript">
	$('.d').click(function(){
		$('.discuss').show();
		$('.mimi').hide();
		return false;
	})
	$('.mi').click(function(){
		$('.discuss').hide();
		$('.mimi').show();
		return false;
	})
</script>
<div class="ww">
  <!--贴子内容-->
@foreach($ider as $k=>$v)
  <div class="discuss" id="discuss_content">
    <ul>
    	
      <li>
        <h3><span id="post_style_0" class="ico_ding"></span><a href="{{url('/ider/huifu',['id'=>$v->id])}}" class="tx_link">{{$v->title}}</a></h3>
        <div class="comment">
          <p id="author_info" class="author_info">提问人：{{$v->uname}} <span class="comTime_0"></span></p>
          <p>{!!$v->content!!}</p>
        </div>
		<input id="style_0" type="hidden" value="8473"/>
		<input id="admin_0" name="aa[]" type="hidden" value="{{$v->id}}"/>
		<input id="time_0" type="hidden" value="1461221059"/>
      </li>
	     </ul>
  </div>
@endforeach
</div>
<div class="mimi" style="display:none">
    <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/public/baidu/lang/zh-cn/zh-cn.js"></script>
	
	<form action="/ider/add" method="post">
	标题:&nbsp;<input type="text" name="title" placeholder="请输入4~30个字符" style="width:500px"><span style="display:none"></span><br>
    内容:<script id="editor" name="content" type="text/plain" placeholder="请输入4~30个字符" style="width:524px;height:150px;">
    </script>
	<div style="height:20px"></div>
    <button style="width:80px;">发表</button>
    {{csrf_field()}}
    </form>
    <!-- ======限制====== -->
<script type="text/javascript">
	//全局变量
	var Title = false;
	//提交事件
	$('form').submit(function(){
		$('input').trigger('blur');
		if(Title){
			return true;
		}
		return false;
	})
	$('input[name=title]').blur(function(){
		var title = $(this).val();
		var reg = /^\S{6,30}$/;
		if(reg.test(title)){
			$(this).next().html(' ').show();
			Title = true;
		}else{
			$(this).next().html('请输入6-30位字符').css('color','red').show();
			Title = false;
			return false;
		}
	})
</script>
<script type="text/javascript">
	//实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{
    	toolbars: [
		    ['fullscreen', 'source', 'undo', 'redo'],
		    ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
		]
    });
</script>
</div>
@endsection